﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Common.OjbectPool
{
    public class DefaultEvictionPolicy<T> : IEvictionPolicy<T>
    {
        public bool Evict(EvictionConfig config, IPooledObject<T> underTest, int idleCount)
        {
            if (config.MinIdle < idleCount ||
                config.IdleEvictTime < underTest.GetIdleTimeMillis())
            {
                return true;
            }
            return false;
        }
    }
}
